﻿import com.kirillam.handy.log.LogWriter;


/**
* Implements log writing to the trace window.
* 
* @author Kirill Mourzenko
*/

class com.kirillam.handy.log.TraceWriter implements LogWriter
{
	
	public function TraceWriter() 
	{
	}
	
	/**
	 * @see	com.kirillam.handy.log.LogWriter.write
	 */
	
	public	function write( level : String, className : String, method : String, output : Object )
	{
		trace( "*** " + level + "  -- from method [" + method + "()] in object of class [" + className + "]");
		
		// TAB INDENT THE MESSAGE FOR READABILITY.
		
		var lines	: Array	= output.toString().split( "\n" );
		for ( var i : Number = 0; i < lines.length; i++ ) {
			trace( "\t" + lines[ i ] );
		}
		
		trace("");
	}
}